package com.lsmw.admin.config;
/*
 *ClassName:AdminWebMveConfig
 *UserName:二号男嘉宾
 *CreateTime:2021/4/23 18:11
 */

import com.lsmw.admin.interceptor.AdminInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AdminWebMveConfig implements WebMvcConfigurer {

    @Bean
    public AdminInterceptor getAdminInterceptor(){
        return new AdminInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(getAdminInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/admin/ls-admin/login")
                .excludePathPatterns("/admin/ls-admin/info")
                .excludePathPatterns("/admin/ls-admin/logout");
    }
}
